home *** CD-ROM | disk | FTP | other *** search
Makefile | 1997-07-08 | 4.0 KB | 159 lines |
- # $Id: Makefile,v 1.2 1997/04/02 22:07:42 beth Exp $
- #
- # Copyright (c) 1988-1997, Research Systems Inc. All rights reserved.
- # This software includes information which is proprietary to and a
- # trade secret of Research Systems, Inc. It is not to be disclosed
- # to anyone outside of this organization. Reproduction by any means
- # whatsoever is prohibited without express written permission.
- #
- # Platform independant makefile for the IDL Call_External() examples.
- #
- SHELL=/bin/sh
- CFLAGS=
- FFLAGS=
-
- SHL_LIBS= simple.$(SHL_EXT) double_array.$(SHL_EXT) string_array.$(SHL_EXT) \
- simple_c2f.$(SHL_EXT) ftn_only.$(SHL_EXT)
-
- # The following is the default entry point. This section will determine
- # what system we are on, set the correct flags and call this same makefile
- # again with the correct flags.
-
- all :
- @echo "OS type detected: "`uname`
- @case `uname` in \
- "SunOS") if [ -d /proc ]; then \
- make libs \
- "SHL_EXT=so" \
- "CC=cc" \
- "F77=f77" \
- "C_LD=cc" \
- "F_LD=f77" \
- "CFLAGS=-K pic -DSPARC -G" \
- "C_LD_FLAGS=-G -DSOLARIS" \
- "FFLAGS=-pic -G" \
- "FOBJS=ftn_only_sun.o ftn_strarr_sun.o" \
- "F_LD_FLAGS=-G" \
- "F_LD_POST= -lF77 -lm -lc"; \
- else \
- make libs \
- "SHL_EXT=so" \
- "CC=acc" \
- "F77=f77" \
- "C_LD=ld" \
- "F_LD=ld" \
- "CFLAGS=-pic -DSPARC -fsingle" \
- "C_LD_FLAGS=-assert pure-text" \
- "F_LD_FLAGS=-assert pure-text" \
- "FFLAGS=-pic" \
- "FOBJS=ftn_only_sun.o ftn_strarr_sun.o" \
- "F_LD_POST= -L/usr/lang/SC3.0.1/lib -lF77 "; \
- fi \
- ;; \
- "AIX") make libs \
- "SHL_EXT=a" \
- "CC=cc" \
- "F77=f77" \
- "C_LD=cc" \
- "F_LD=f77" \
- "C_LD_FLAGS=-bM:SRE -bnoentry" \
- "F_LD_FLAGS=-bM:SRE -bnoentry" \
- "SIMPLE_EXPORT=-bE:simple.exp" \
- "DOUBLE_EXPORT=-bE:double_array.exp" \
- "STRING_EXPORT=-bE:string_array.exp" \
- "SIMPLEC2F_EXPORT=-bE:simple_c2f.exp" \
- "FORTRAN_EXPORT=-bE:ftn_only.exp" \
- "FOBJS=ftn_only_ibm.o" \
- "F_LD_POST= -lxlf -lxlf90";; \
- "HP-UX") make libs \
- "SHL_EXT=sl" \
- "CC=cc" \
- "F77=f77" \
- "C_LD=ld" \
- "F_LD=ld" \
- "CFLAGS=+z" \
- "C_LD_FLAGS=-b" \
- "F_LD_FLAGS=-b" \
- "FFLAGS=+z" \
- "FOBJS=ftn_only_hp.o ftn_strarr_hp.o" ;; \
- "IRIX" ) make libs \
- "SHL_EXT=so" \
- "CC=cc" \
- "F77=@echo \"NOT Implemented for example: f77 \"" \
- "C_LD=ld" \
- "F_LD=@echo \"NOT Implemented for example: f77 \"" \
- "CFLAGS=-KPIC" \
- "C_LD_FLAGS=-shared";; \
- "OSF1" ) make libs \
- "SHL_EXT=so" \
- "CC=cc" \
- "F77=f77" \
- "C_LD=ld" \
- "F_LD=ld" \
- "CFLAGS=-DOSF1" \
- "C_LD_FLAGS=-S -shared" \
- "F_LD_FLAGS=-S -shared" \
- "FOBJS=ftn_only_osf1.o" \
- "F_LD_POST= -lUfor -lfor -lFutil -lm -lots -lc";; \
- "Linux" ) make libs \
- "SHL_EXT=so" \
- "CC=cc" \
- "F77=@echo \"NOT Implemented for example: f77 \"" \
- "C_LD=ld" \
- "F_LD=@echo \"NOT Implemented for example: f77 \"" \
- "CFLAGS=-fPIC" \
- "C_LD_FLAGS=-shared";; \
- *) echo "This system is not supported" ;; \
- esac
-
- libs : $(SHL_LIBS)
- @echo ""
- @echo "To test the call external examples, start IDL and execute one"
- @echo "of the following IDL procedures: c_only, simple_c2f or ftn_only"
-
- # C Only libs
-
- simple.$(SHL_EXT) : simple.o
- $(C_LD) $(C_LD_FLAGS) -o simple.$(SHL_EXT) simple.o $(SIMPLE_EXPORT) \
- $(C_LD_POST)
-
- double_array.$(SHL_EXT) : double_array.o
- $(C_LD) $(C_LD_FLAGS) -o double_array.$(SHL_EXT) double_array.o \
- $(DOUBLE_EXPORT) $(C_LD_POST)
-
- string_array.$(SHL_EXT) : string_array.o
- $(C_LD) $(C_LD_FLAGS) -o string_array.$(SHL_EXT) string_array.o \
- $(STRING_EXPORT) $(C_LD_POST)
-
- # Fortran
-
- simple_c2f.$(SHL_EXT) : simple_c2f.o simple_c2f1.o
- $(F_LD) $(F_LD_FLAGS) -o simple_c2f.$(SHL_EXT) \
- simple_c2f.o simple_c2f1.o $(SIMPLEC2F_EXPORT) $(F_LD_POST)
-
-
- ftn_only.$(SHL_EXT) : $(FOBJS)
- $(F_LD) $(F_LD_FLAGS) -o ftn_only.$(SHL_EXT) $(FOBJS) \
- $(FORTRAN_EXPORT) $(F_LD_POST)
-
- # Cleanup
-
- tidy :
- rm -f *.o
-
- clean :
- rm -f *.o *.so *.sl *.a
-
-
- # Rules for building the object files.
-
- .SUFFIXES: .c .o .f
-
- .c.o :
- $(CC) $(CFLAGS) -c $*.c
-
- .f.o :
- $(F77) $(FFLAGS) -c $*.f
-
-
-